home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / ici / ici.cpi / tst-stmt.ici < prev    next >
Text File  |  1994-10-27  |  489b  |  33 lines

  1. static x;
  2. static y;
  3.  
  4. x = 1;
  5. {
  6.      x += 2;
  7.      x += 3;
  8. }
  9. if (x != 6)
  10.     fail("compound statement effected flow");
  11.  
  12. y = 0;
  13. forall (x in [array 4, 5, 6])
  14.     y += x;
  15. if (y != 15)
  16.     fail("forall loop gave wrong sum");
  17.  
  18. y = 0;
  19. forall (x in NULL)
  20.     y += x;
  21. if (y != 0)
  22.     fail("NULL forall loop failed");
  23.  
  24.  
  25. x = [struct];
  26. super(x, y = @[struct a = 1]);
  27. ++x.a;
  28. super(x, NULL);
  29. if (x.a != 2)
  30.     fail("failed to inc new element");
  31. if (y.a != 1)
  32.     fail("changed element in atomic super");
  33.